<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<!doctype html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible"
          content="IE=9; IE=8; IE=7; IE=EDGE">
<meta charset="utf-8" />
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta content="telephone=no" name="format-detection"/>
    <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<title>登录管理中心</title>
	<link rel="shortcut icon" href="<?php echo URLPRE;?>static/public/images/site.ico" mce_href="<?php echo URLPRE;?>static/public/images/site.ico" type="image/x-icon">

	<script type="text/javascript" src="<?php echo URLPRE;?>static/public/js/jquery/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="<?php echo URLPRE;?>static/public/js/device.js"></script>
	<script type="text/javascript"
			src="<?php echo URLPRE; ?>static/template/<?php echo MOBILE_TEMPLATE_NAME ?>/mobile/js/layer/layer.js"></script>

	<link href="<?php echo URLPRE;?>static/login/pad_m.css" rel="stylesheet" />

	<!-- 阿里字体-->
	<link href="<?php echo URLPRE;?>static/public/iconfont/iconfont.css" rel="stylesheet" />


	<script>

	$(function () {
		var wURl = '<?php echo URLPRE;?>static/login/wrapper/';
		var iUrl = wURl + '24_m.png';
		$('body').append('<img src="' + iUrl + '" id="js-image-wrap" style="display: none">');
		$('#js-image-wrap').load(function () {
			$('body').css({
				"background": "#fdf8f4 url(" + iUrl + ") no-repeat",
				"background-size": "cover"
			});
		})


        var username = localStorage.getItem("username");

        var password = localStorage.getItem("password");

        $('input[name="username"]').val(username);
        $('input[name="password"]').val(password);

        $(document).on("click", ".J_login", function () {
 

            var username = $("input[name='username']").val();

            var password = $("input[name='password']").val();
            var refer = $("input[name='refer']").val();


            username = $.trim(username);
            password = encodeURIComponent($.trim(password));


            var data = {
                username: username,
                refer: refer,
                password: password
            };
            $.post("<?php echo site_url('admin/index/ajax_tologin'); ?>", data, function (res) {

                if (res.status == 0) {
                    layer.msg(res.info);
                }

                if (res.status == 1) {
                    localStorage.setItem("password",password);
                    localStorage.setItem("username",username);

                    layer.msg(res.info,{time:2000},function () {
                        window.location.href = res.url;
                    });

                }
            });
        });

	})



	</script>

</head>
<body>

<div class="wrap">
  <div class="inner">
    <div class="header">
		<h1> <i class="icon iconfont">&#xe681;</i></h1>
    </div>
    <div class="qzone_login clearfix">
      <!-- end qzone_cont -->
      <div class="login_main">

          <ul class="login_list"  id="web_login">
            <li class="login_input">
              <input id="u" name="username" class="input_txt" tabindex="1" type="text"  placeholder="请输入帐号名" title="帐号名"  />
            </li>
            <li class="login_input">
              <input maxlength=16 type="password"  name="password" tabindex="2" class="input_txt" type="text" value=""  placeholder="请输入密码" title="密码"/>
            </li>
              <input type="hidden" name="refer" value="<?php echo site_url('hm/index')?>">
			  <li class="login_input">
				  <button class="login_btn J_login" >登录</button>
			  </li>

          </ul>

       </div>
    </div>

  </div>
</div>



</body>
</html>